home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
os20
/
wb
/
ArcAndMore.lha
/
Arc.rexx
next >
Wrap
OS/2 REXX Batch file
|
1993-02-16
|
2KB
|
82 lines
/* Arc.rexx - Arexx script to uncompress .zoo, .lzh and .lha files! */
/* It also compressed dirs and files with LhA */
/* Copyright (c) 1992,1993 by Markus Aalto. */
/* V1.0: 23.08.1992 */
PARSE ARG DataFileName
ADDLIB('rexxsupport.library',0,-30,0)
DestinationDir = "RAM:"
LhAName = "NewC:LhA"
LhAExtract = "x"
LhAAdd = "-x -r a"
ZooName = "NewC:Zoo"
ZooExtract "-x//"
IF DataFileName ~= "" THEN DO
IF LEFT(DataFileName,1) = '"' THEN DO
PARSE VAR DataFileName '"' Name '"'
DataFileName = Name
END
ELSE DO
Name = DataFileName
END
Extension = RIGHT(DataFileName,4)
DataFileName = '"' || DataFileName || '"'
IF COMPARE(Extension,".zoo") = 0 THEN DO
ADDRESS COMMAND ZooName ZooExtract DataFileName
END
ELSE IF COMPARE(Extension,".lzh") = 0 | COMPARE(Extension,".lha") = 0 THEN DO
ADDRESS COMMAND LhAName LhAExtract DataFileName DestinationDir
END
ELSE DO
IF COMPARE( LEFT( STATEF(Name) ,3) ,"DIR") = 0 THEN DO
RealName = get_realname( Name )
ArcCommand = LhAName LhAAdd '"' || DestinationDir || RealName || ".lha" || '"'
InfoFileName = Name || ".info"
IF EXISTS( InfoFileName ) THEN DO
ArcCommand = ArcCommand '"' || InfoFileName || '"'
END
ADDRESS COMMAND ArcCommand '"' || Name || "/#?" || '"'
END
ELSE DO
RealName = get_realname( Name )
ArcCommand = LhAName "a" '"' || DestinationDir || RealName || ".lha" || '"'
InfoFileName = Name || ".info"
IF EXISTS( InfoFileName ) THEN DO
ArcCommand = ArcCommand '"' || InfoFileName || '"'
END
ADDRESS COMMAND ArcCommand DataFileName
END
END
END
EXIT
get_realname:
WholeName = arg(1)
Position = LASTPOS("/",WholeName)
IF Position = 0 THEN DO
Position = POS(":",WholeName)
IF Position = 0 THEN DO
Realname = WholeName
END
ELSE DO
Realname = RIGHT( WholeName, LENGTH(WholeName) - Position );
END
END
ELSE DO
Realname = RIGHT( WholeName, LENGTH(WholeName) - Position );
END
return Realname